package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	private String Id;
	private String firstName;
	private String lastName;
	private String address;
	private String homephone;
	private String mobile;
	private String workphone;
	private String email1;
	private String email2;
	private String bday;
	private String bmonth;
	private String byear;
	private String group;
	private String address2;
	private String phone2;

	public ContactData(String firstName, String lastName, String address,
			String homephone, String mobile, String workphone, String email1,
			String email2, String bday, String bmonth, String byear,
			String group, String address2, String phone2) {
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		this.homephone = homephone;
		this.mobile = mobile;
		this.workphone = workphone;
		this.email1 = email1;
		this.email2 = email2;
		this.bday = bday;
		this.bmonth = bmonth;
		this.byear = byear;
		this.group = group;
		this.address2 = address2;
		this.phone2 = phone2;
	}

	public ContactData() {
	}

	@Override
	public int compareTo(ContactData other) {
		return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
	}

	@Override
	public String toString() {
		return "ContactData [lastName=" + lastName + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		//result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}
	
	 public ContactData withId(String Id) {
         this.Id = Id;
         return this;
 }

	public ContactData withfirstName(String firstName) {
		this.firstName = firstName;
		return this;
	}
	
	public ContactData withLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}
	
	public ContactData withaddress(String address) {
		this.address = address;
		return this;
	}
	
	public ContactData withaddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	
	public ContactData withbday(String bday) {
		this.bday = bday;
		return this;
	}
	
	public ContactData withbmonth(String bmonth) {
		this.bmonth = bmonth;
		return this;
	}
	
	public ContactData withbyear(String byear) {
		this.byear = byear;
		return this;
	}
	public ContactData withemail1(String email1) {
		this.email1 = email1;
		return this;
	}
	
	public ContactData withemail2(String email2) {
		this.email2 = email2;
		return this;
	}
	
	public ContactData withgroup(String group) {
		this.group = group;
		return this;
	}
	
	public ContactData withhomephone(String homephone) {
		this.homephone = homephone;
		return this;
	}
	
	public ContactData withmobile(String mobile) {
		this.mobile = mobile;
		return this;
	}
	
	public ContactData withworkphone(String workphone) {
		this.workphone = workphone;
		return this;
	}

	public String getId() {
        return Id;
}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAddress() {
		return address;
	}

	public String getHomephone() {
		return homephone;
	}

	public String getMobile() {
		return mobile;
	}

	public String getWorkphone() {
		return workphone;
	}

	public String getEmail1() {
		return email1;
	}

	public String getEmail2() {
		return email2;
	}

	public String getBday() {
		return bday;
	}

	public String getBmonth() {
		return bmonth;
	}

	public String getByear() {
		return byear;
	}

	public String getGroup() {
		return group;
	}

	public String getAddress2() {
		return address2;
	}

	public String getPhone2() {
		return phone2;
	}

	public void setId(String id) {
		Id = id;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setHomephone(String homephone) {
		this.homephone = homephone;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public void setWorkphone(String workphone) {
		this.workphone = workphone;
	}

	public void setEmail1(String email1) {
		this.email1 = email1;
	}

	public void setEmail2(String email2) {
		this.email2 = email2;
	}

	public void setBday(String bday) {
		this.bday = bday;
	}

	public void setBmonth(String bmonth) {
		this.bmonth = bmonth;
	}

	public void setByear(String byear) {
		this.byear = byear;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}
	
}